<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="{$appConfigs[member_title]}">
    <title>购物车-用户中心</title>
    {run $pageName='order'}<!--用于加载对应页面的css-->
    {include member.inc.csslink}
</head>
<body>
{run $payTitle='结算页'}
{include member.inc.header_pay}
<main class="max-w">
    <!--<div class="breadcrumb">您现在的位置：<a href="/member/order/car/index">订单管理</a> > 购物车</div>-->
    <!--{include member.inc.leftNav}-->
    <div class="main order_car" style="width: auto;">
        <section class="panel">
            <div class="header3">
                <ul class="r progress2  step0">
                    <li>
                        <span class="circle"></span>
                        <div class="text">我的购物车</div>
                    </li>
                    <li>
                        <span class="circle"></span>
                        <div class="text">填写核对购物车信息</div>
                    </li>
                    <li>
                        <span class="circle"></span>
                        <div class="text">支付货款</div>
                    </li>
                    <li>
                        <span class="circle"></span>
                        <div class="text">订单完成</div>
                    </li>
                </ul>

                <h1>我的购物车</h1>
                <p>查看购物车商品信息，增加减少商品数量，并勾选想要的商品进入下一步</p>
            </div>
            {if empty($item[product])}
            <p class="c-info max-w">您的购物车已经空空如也,赶紧到我们的 <a href="/trading/product/index" class="link2"> 交易市场 </a> 逛逛吧! ^_^</p>
            {else}
            <form method="POST" action="/member/order/createOrder">
                <table class="table table1">
                    <thead>
                    <tr>
                        <td width="50">
                            <div class="checkbox-wrap">
                                <input type='checkbox' class="check_all" id="checkAll1"/>
                                <label for="checkAll1" class="check_box"></label>
                                <span>全选</span>
                            </div>
                        </td>
                        <td width="120">商品</td>
                        <!--<td width="60">货号</td>-->
                        <td width="50">交收地</td>
                        <td width="60">交收方式</td>
                        <td width="90">销售价(元/{$pro_unit})</td>
                        <td width="80">库存数量({$pro_unit})</td>
                        <td width="100">最小交易量({$pro_unit})</td>
                        <td width="100">购买数量</td>
                        <td width="65">金额(元)</td>
                        <td width="40">操作</td>
                    </tr>
                    </thead>
                    <tbody>
                    {loop $item[product] $k $v}
                    <tr>
                        <td>
                            <div class="checkbox-wrap">
                                <input type="hidden" name="delivery_way[]" value="{$v[delivery_way]}">
                                <input type="hidden" name="repertory_id[]" value="{$v[repertory_id]}">
                                <input type="hidden" name="has[]" value="{$v[has]}">
                                <input id="cert_{$k}" type="checkbox" name="id[]" value="{$v[id]}" {if $v[has]>=0} checked{else} disabled{/if}>
                                <label for="cert_{$k}" class="check_box"></label>
                            </div>
                        </td>
                        <td class="break-word">{$v[name]}{if $v[has]<0}<span style="color: red">库存不足</span>{/if}</td>
                        <!--<td class="break-word">{$v[product_no]}</td>-->
                        <td class="break-word">{$v[address]}</td>
                        <td class="break-word">{$v[deliveryway]}</td>
                        <td>￥<span class="price">{$v[sales_price]}</span></td>
                        <td>{$v[max_volume]}</td>
                        <td>{$v[min_volume]}</td>
                        <td>
                            <div class="num_box">
                                <a href="javascript:;" class="cut"></a>
                                <input type="text" name="quantity[]" value="{if $v[has]>=0}{$v[min_volume]}{else}0{/if}" class="num" data-min="{$v[min_volume]}" data-max="{$v[max_volume]}" {if $v[has]<0} disabled{/if}/>
                                <a href="javascript:;" class="add"></a>
                            </div>
                        </td>
                        <td class="c-danger">￥<span class="count">{if $v[has]>=0}{$v[price]}{else}0{/if}</span></td>
                        <td><a href="javascript:;" class="link2" data-act="del" data-id="{$v[id]}">删除</a></td>
                    </tr>
                    {/loop}
                    </tbody>
                </table>
                <div class="pay_bar">
                    <!--<span class="checkbox-wrap">
                        <input id="checkall" class="check_all" type="checkbox" name="gender" value="cert" checked>
                        <label for="checkall" class="check_box"> &nbsp;&nbsp;全选</label>
                    </span>-->
                    <div class="checkbox-wrap fl">
                        <input type='checkbox' class="check_all" id="checkAll2"/>
                        <label for="checkAll2" class="check_box"></label>
                        <span>全选</span>
                    </div>
                    <div class="fr">
                        <span class="mgr25">已选商品：<b class="c-primary"><span class="all_num"></span>{$pro_unit}</b></span>
                        <span class="mgr25">应付总额：<b class="c-primary">￥<span class="all_count">0</span></b></span>
                        <input type="hidden" name="isCart" value="1">
                        <a href="javascript:void(0);" class="pay_btn">去结算</a>
                    </div>

                </div>
                <input type="hidden" id="has_checkId">
            </form>
            {/if}
        </section>
    </div>
</main>


{include member.inc.footer}
{include member.inc.script}

<script>
    seajs.use('order_car', function (order_cart) {
        order_cart.leftNavIndex = {dl: 1, dd: 0};
        order_cart.delCartProductUrl= '/member/order/delCartProduct'//确认订单
        order_cart.init();
    });
</script>
{include member.inc.foot_hook}
</body>
</html>
